package com.example.mapper;

import com.example.entity.Building;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @project: smart-property
 * @description: 楼栋管理 mapper 层
 * @author: cjq
 * @create: 2022-11-17 15:24
 **/
@Mapper
public interface BuildingMapper {
    /**
     * 添加楼栋信息
     * @param building
     * @return
     */
    int addBuildingInfo(Building building);

    /**
     * 修改楼栋信息
     * @param building
     * @return
     */
    int updateBuildingInfo(Building building);

    /**
     * 小区楼座查重
     * @param cid
     * @param building
     * @return
     */
    Building listBuildingName(@Param("cid") Integer cid,@Param("building") String building);

    /**
     * 楼栋信息列表查询
     * @param purpose
     * @param building
     * @return
     */
    List<Building> queryBuildingInfo(@Param("purpose") String purpose,@Param("building") String building,@Param("cid") Integer cid);

    /**
     * 删除楼栋信息
     * @param id
     * @return
     */
    int delBuildingInfo(@Param("id") Integer id);

    /**
     * 批量删除楼栋信息
     * @param ids
     * @return
     */
    int batchDel(@Param("id") Integer[] ids);
}
